/*
 * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef STATION_CONTROLLER_H
#define STATION_CONTROLLER_H

#include "base_thing_model.h"
#include "sle_thing_model_define.h"

namespace OHOS {
namespace iotConnect {
class StationController : public AbstractDevice{
public:
    virtual int32_t DevInfoGetCharState(const IotcCharState inData, char **data, uint32_t *len) const override;
    virtual int32_t ConfigurationManagementGetCharState(const IotcCharState inData, char **data, uint32_t *len) override;
    virtual int32_t ConfigurationManagementPutCharState(const IotcCharState inData, const char *data, uint32_t len) override;
    
    virtual int32_t InternalHandler(const IotcCharState inData, char **out, uint32_t *len,
        ThingModelPutOrGet flag = ThingModelPutOrGet::GET) override;
    virtual int32_t GetAllInfoHandler(const std::string& devId, IotcCharState *state) override;
    
    
    
    // static int32_t SleInfoGetCharState (const char *devId, const IotcServiceInfo *svc, char **data, uint32_t *len);
    // static int32_t WifiInfoGetCharState (const char *devId, const IotcServiceInfo *svc, char **data, uint32_t *len);
    // static int32_t ConfigurationManagementGetCharState (const char *devId, const IotcServiceInfo *svc, char **data, uint32_t *len);
    // static int32_t ConfigurationManagementPutCharState (const char *devId, const IotcServiceInfo *svc, const char *data, uint32_t len);
    // static int32_t CPUInfoGetCharState (const char *devId, const IotcServiceInfo *svc, char **data, uint32_t *len);
    // static int32_t OSInfoGetCharState (const char *devId, const IotcServiceInfo *svc, char **data, uint32_t *len);
    // static int32_t OTAInfoGetCharState (const char *devId, const IotcServiceInfo *svc, char **data, uint32_t *len);
    // static int32_t OTAInfoPutCharState (const char *devId, const IotcServiceInfo *svc, const char *data, uint32_t len);
    // static int32_t RestartInfoGetCharState (const char *devId, const IotcServiceInfo *svc, char **data, uint32_t *len);
    // static int32_t RestartInfoPutCharState (const char *devId, const IotcServiceInfo *svc, const char *data, uint32_t len);
    // static int32_t FactoryResetGetCharState (const char *devId, const IotcServiceInfo *svc, char **data, uint32_t *len);
    // static int32_t FactoryResetPutCharState (const char *devId, const IotcServiceInfo *svc, const char *data, uint32_t len);

    static int32_t GetSleBaseDeviceInfo(SleBaseDeviceInfo& devInfo);
    int32_t GetSn(char **data, uint32_t *len);
    int32_t PutSn(const char *data, uint32_t len);

private:
    static SleBaseDeviceInfo sleBaseDeviceInfo_;
    //     .brand = "skh",
    //     .deviceId = "000001",
    // };
    static SleBaseWiFiInfo sleBaseWiFiInfo_;
    static SleBaseSleInfo sleBaseSleInfo_;
    static ConfigurationManagementInfo configurationManagementInfo_;
    static SleBaseCPUInfo sleBaseCPUInfo_;
    static SleBaseOSInfo sleBaseOSInfo_;
    static SleBaseOTAInfo sleBaseOTAInfo_;
    static SleBaseRestartInfo sleBaseRestartInfo_;
    static SleBaseFactoryReset sleBaseFactoryReset_;

    const std::string JSON_STR_SNW{"snw"};
};
}
}
#endif
